﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>商品 - 狗东管理系统</title>
  <link href="../../css/admin/common.css" type="text/css" rel="stylesheet">
  <style type="text/css">
		table{
			text-align: center;
			border-collapse: collapse;
		}
		.bgcolor{
			background-color: #ccc;
		}
        html{
            overflow: hidden;
        }
        #headerWrapper {
            width: 768px;
            border-bottom: none;
        }
        #listWrapper {
            display: block;
            width: 776px;
            height: 360px;
            overflow-y: scroll;
            border-top: none;
        }
	</style>
	<script type="text/javascript">
		function changeColor(obj){
			obj.className = "bgcolor";
		}
		function changeColor1(obj){
			obj.className = "";
		}
	</script>
</head>
<body>
	<table id="headerWrapper" border="1" bordercolor="#ccc">
		<tr>
			<th width="100px">ID</th>
			<th width="200px">名称</th>
			<th width="200px">价格</th>
			<th width="100px">库存</th>
			<th width="50px">详情</th>
            <th width="100px" colspan="2">操作</th>
		</tr>
    </table>
    <table id="listWrapper" border="1" bordercolor="#ccc">
        <tr>
            <th width="100px"> </th>
            <th width="200px"> </th>
            <th width="200px"> </th>
            <th width="100px"> </th>
            <th width="50px"> </th>
            <th width="100px" colspan="2"> </th>
        </tr>
        <c:forEach items="${products}" var="product">
            <tr onmousemove="changeColor(this)" onmouseout="changeColor1(this)">
                <td>${product.id}</td>
                <td>${product.gname}</td>
                <td>${product.grprice}</td>
                <td>${product.gstore}</td>
                <td><a href="/product/detail?id=${product.id}" target="_blank">详情</a></td>
                <td>
                    <a href="/management/product/edit?id=${product.id}">编辑</a>
                </td>
                <td>
                    <a style="color: red" href="/management/product/remove?id=${product.id}">删除</a>
                </td>
            </tr>
        </c:forEach>
	</table>
</body>
</html>
